# -*- coding: utf-8 -*-

# File Name : load_model
# Description :
# Author : marje
# date : 2022/8/11
# Change Activity : 2022/8/11
import torch

from ..inference import is_key_right_
from ... import join_relative_path


def load_state_dict_(model_, model_path_):
    if is_key_right_:
        state_dict = torch.load(join_relative_path(model_path_))
        model_.load_state_dict(state_dict)
    return model_
